// $ANTLR 3.3 Nov 30, 2010 12:45:30 /home/ashwin/NetBeansProjects/test/src/test/Process.g 2011-03-18 22:47:43

package antlrpack;
import model.Location;
import model.UserData;
import org.hibernate.Session;
import org.hibernate.Transaction;
import hibernate.util.SessionFactoryUtil;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

public class ProcessParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "ID", "NEWLINE", "TRAFFIC", "BLOCK", "INT", "MIN", "HRS", "COLON", "DOT", "AM", "PM", "TIME", "FRACT", "TA", "WS", "'ok'", "'normal'", "'smooth'", "'at'", "'in'", "'by'"
    };
    public static final int EOF=-1;
    public static final int T__19=19;
    public static final int T__20=20;
    public static final int T__21=21;
    public static final int T__22=22;
    public static final int T__23=23;
    public static final int T__24=24;
    public static final int ID=4;
    public static final int NEWLINE=5;
    public static final int TRAFFIC=6;
    public static final int BLOCK=7;
    public static final int INT=8;
    public static final int MIN=9;
    public static final int HRS=10;
    public static final int COLON=11;
    public static final int DOT=12;
    public static final int AM=13;
    public static final int PM=14;
    public static final int TIME=15;
    public static final int FRACT=16;
    public static final int TA=17;
    public static final int WS=18;

    // delegates
    // delegators


        public ProcessParser(TokenStream input) {
            this(input, new RecognizerSharedState());
        }
        public ProcessParser(TokenStream input, RecognizerSharedState state) {
            super(input, state);
             
        }
        

    public String[] getTokenNames() { return ProcessParser.tokenNames; }
    public String getGrammarFileName() { return "/home/ashwin/NetBeansProjects/test/src/test/Process.g"; }


    public Session session;
    public ProcessParser(TokenStream input,int id)
    {
    this(input);
    session = SessionFactoryUtil.getSessionFactory().openSession();
    }



    // $ANTLR start "prog"
    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:28:1: prog : alt ;
    public final void prog() throws RecognitionException {
        try {
            // /home/ashwin/NetBeansProjects/test/src/test/Process.g:28:6: ( alt )
            // /home/ashwin/NetBeansProjects/test/src/test/Process.g:28:8: alt
            {
            pushFollow(FOLLOW_alt_in_prog28);
            alt();

            state._fsp--;


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "prog"


    // $ANTLR start "alt"
    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:34:1: alt : (a= time ( others )* traffic prep b= ID ( others | ID )* normal prep d= time ( others | ID | NEWLINE )* | ( ID | others )* traffic prep e= ID ( ID | others )* time ( ID | others )* );
    public final void alt() throws RecognitionException {
        Token b=null;
        Token e=null;
        ProcessParser.time_return a = null;

        ProcessParser.time_return d = null;

        ProcessParser.time_return time1 = null;


        try {
            // /home/ashwin/NetBeansProjects/test/src/test/Process.g:34:5: (a= time ( others )* traffic prep b= ID ( others | ID )* normal prep d= time ( others | ID | NEWLINE )* | ( ID | others )* traffic prep e= ID ( ID | others )* time ( ID | others )* )
            int alt7=2;
            int LA7_0 = input.LA(1);

            if ( (LA7_0==TIME) ) {
                alt7=1;
            }
            else if ( (LA7_0==ID||LA7_0==TRAFFIC||(LA7_0>=COLON && LA7_0<=DOT)||(LA7_0>=22 && LA7_0<=24)) ) {
                alt7=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 7, 0, input);

                throw nvae;
            }
            switch (alt7) {
                case 1 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:34:7: a= time ( others )* traffic prep b= ID ( others | ID )* normal prep d= time ( others | ID | NEWLINE )*
                    {
                    pushFollow(FOLLOW_time_in_alt42);
                    a=time();

                    state._fsp--;

                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:34:14: ( others )*
                    loop1:
                    do {
                        int alt1=2;
                        int LA1_0 = input.LA(1);

                        if ( ((LA1_0>=COLON && LA1_0<=DOT)||(LA1_0>=22 && LA1_0<=24)) ) {
                            alt1=1;
                        }


                        switch (alt1) {
                    	case 1 :
                    	    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:34:15: others
                    	    {
                    	    pushFollow(FOLLOW_others_in_alt45);
                    	    others();

                    	    state._fsp--;


                    	    }
                    	    break;

                    	default :
                    	    break loop1;
                        }
                    } while (true);

                    pushFollow(FOLLOW_traffic_in_alt49);
                    traffic();

                    state._fsp--;

                    pushFollow(FOLLOW_prep_in_alt51);
                    prep();

                    state._fsp--;

                    b=(Token)match(input,ID,FOLLOW_ID_in_alt55); 
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:34:42: ( others | ID )*
                    loop2:
                    do {
                        int alt2=3;
                        int LA2_0 = input.LA(1);

                        if ( ((LA2_0>=COLON && LA2_0<=DOT)||(LA2_0>=22 && LA2_0<=24)) ) {
                            alt2=1;
                        }
                        else if ( (LA2_0==ID) ) {
                            alt2=2;
                        }


                        switch (alt2) {
                    	case 1 :
                    	    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:34:43: others
                    	    {
                    	    pushFollow(FOLLOW_others_in_alt58);
                    	    others();

                    	    state._fsp--;


                    	    }
                    	    break;
                    	case 2 :
                    	    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:34:50: ID
                    	    {
                    	    match(input,ID,FOLLOW_ID_in_alt60); 

                    	    }
                    	    break;

                    	default :
                    	    break loop2;
                        }
                    } while (true);

                    pushFollow(FOLLOW_normal_in_alt64);
                    normal();

                    state._fsp--;

                    pushFollow(FOLLOW_prep_in_alt66);
                    prep();

                    state._fsp--;

                    pushFollow(FOLLOW_time_in_alt70);
                    d=time();

                    state._fsp--;

                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:34:73: ( others | ID | NEWLINE )*
                    loop3:
                    do {
                        int alt3=4;
                        switch ( input.LA(1) ) {
                        case COLON:
                        case DOT:
                        case 22:
                        case 23:
                        case 24:
                            {
                            alt3=1;
                            }
                            break;
                        case ID:
                            {
                            alt3=2;
                            }
                            break;
                        case NEWLINE:
                            {
                            alt3=3;
                            }
                            break;

                        }

                        switch (alt3) {
                    	case 1 :
                    	    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:34:74: others
                    	    {
                    	    pushFollow(FOLLOW_others_in_alt72);
                    	    others();

                    	    state._fsp--;


                    	    }
                    	    break;
                    	case 2 :
                    	    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:34:81: ID
                    	    {
                    	    match(input,ID,FOLLOW_ID_in_alt74); 

                    	    }
                    	    break;
                    	case 3 :
                    	    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:34:84: NEWLINE
                    	    {
                    	    match(input,NEWLINE,FOLLOW_NEWLINE_in_alt76); 

                    	    }
                    	    break;

                    	default :
                    	    break loop3;
                        }
                    } while (true);

                    System.out.println(a.value1+"."+a.value2);
                    System.out.println(":"+(b!=null?b.getText():null)); System.out.println((d!=null?d.value1:0)+"."+(d!=null?d.value2:0));

                    Transaction tx = session.beginTransaction();

                    GregorianCalendar cal = new GregorianCalendar();
                    cal.set(Calendar.HOUR, (a!=null?a.value1:0));
                      cal.set(Calendar.MINUTE,(a!=null?a.value2:0));
                    Date cur=cal.getTime();
                    UserData data=new UserData();
                    data.setUserTime(cur);
                    session.save(data);
                    tx.commit();


                    }
                    break;
                case 2 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:48:1: ( ID | others )* traffic prep e= ID ( ID | others )* time ( ID | others )*
                    {
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:48:1: ( ID | others )*
                    loop4:
                    do {
                        int alt4=3;
                        int LA4_0 = input.LA(1);

                        if ( (LA4_0==ID) ) {
                            alt4=1;
                        }
                        else if ( ((LA4_0>=COLON && LA4_0<=DOT)||(LA4_0>=22 && LA4_0<=24)) ) {
                            alt4=2;
                        }


                        switch (alt4) {
                    	case 1 :
                    	    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:48:2: ID
                    	    {
                    	    match(input,ID,FOLLOW_ID_in_alt83); 

                    	    }
                    	    break;
                    	case 2 :
                    	    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:48:5: others
                    	    {
                    	    pushFollow(FOLLOW_others_in_alt85);
                    	    others();

                    	    state._fsp--;


                    	    }
                    	    break;

                    	default :
                    	    break loop4;
                        }
                    } while (true);

                    pushFollow(FOLLOW_traffic_in_alt89);
                    traffic();

                    state._fsp--;

                    pushFollow(FOLLOW_prep_in_alt91);
                    prep();

                    state._fsp--;

                    e=(Token)match(input,ID,FOLLOW_ID_in_alt95); 
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:48:32: ( ID | others )*
                    loop5:
                    do {
                        int alt5=3;
                        int LA5_0 = input.LA(1);

                        if ( (LA5_0==ID) ) {
                            alt5=1;
                        }
                        else if ( ((LA5_0>=COLON && LA5_0<=DOT)||(LA5_0>=22 && LA5_0<=24)) ) {
                            alt5=2;
                        }


                        switch (alt5) {
                    	case 1 :
                    	    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:48:33: ID
                    	    {
                    	    match(input,ID,FOLLOW_ID_in_alt98); 

                    	    }
                    	    break;
                    	case 2 :
                    	    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:48:36: others
                    	    {
                    	    pushFollow(FOLLOW_others_in_alt100);
                    	    others();

                    	    state._fsp--;


                    	    }
                    	    break;

                    	default :
                    	    break loop5;
                        }
                    } while (true);

                    pushFollow(FOLLOW_time_in_alt104);
                    time1=time();

                    state._fsp--;

                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:48:50: ( ID | others )*
                    loop6:
                    do {
                        int alt6=3;
                        int LA6_0 = input.LA(1);

                        if ( (LA6_0==ID) ) {
                            alt6=1;
                        }
                        else if ( ((LA6_0>=COLON && LA6_0<=DOT)||(LA6_0>=22 && LA6_0<=24)) ) {
                            alt6=2;
                        }


                        switch (alt6) {
                    	case 1 :
                    	    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:48:51: ID
                    	    {
                    	    match(input,ID,FOLLOW_ID_in_alt107); 

                    	    }
                    	    break;
                    	case 2 :
                    	    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:48:54: others
                    	    {
                    	    pushFollow(FOLLOW_others_in_alt109);
                    	    others();

                    	    state._fsp--;


                    	    }
                    	    break;

                    	default :
                    	    break loop6;
                        }
                    } while (true);

                    System.out.println((time1!=null?time1.value1:0)+"."+(time1!=null?time1.value2:0)+(e!=null?e.getText():null));

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "alt"


    // $ANTLR start "traffic"
    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:51:1: traffic returns [String args] : ( TRAFFIC | TRAFFIC BLOCK );
    public final String traffic() throws RecognitionException {
        String args = null;

        try {
            // /home/ashwin/NetBeansProjects/test/src/test/Process.g:51:30: ( TRAFFIC | TRAFFIC BLOCK )
            int alt8=2;
            int LA8_0 = input.LA(1);

            if ( (LA8_0==TRAFFIC) ) {
                int LA8_1 = input.LA(2);

                if ( (LA8_1==BLOCK) ) {
                    alt8=2;
                }
                else if ( ((LA8_1>=22 && LA8_1<=24)) ) {
                    alt8=1;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 8, 1, input);

                    throw nvae;
                }
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 8, 0, input);

                throw nvae;
            }
            switch (alt8) {
                case 1 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:51:31: TRAFFIC
                    {
                    match(input,TRAFFIC,FOLLOW_TRAFFIC_in_traffic123); 

                    }
                    break;
                case 2 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:51:39: TRAFFIC BLOCK
                    {
                    match(input,TRAFFIC,FOLLOW_TRAFFIC_in_traffic125); 
                    match(input,BLOCK,FOLLOW_BLOCK_in_traffic127); 

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return args;
    }
    // $ANTLR end "traffic"


    // $ANTLR start "normal"
    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:55:1: normal : ( 'ok' | 'normal' | 'smooth' );
    public final void normal() throws RecognitionException {
        try {
            // /home/ashwin/NetBeansProjects/test/src/test/Process.g:55:8: ( 'ok' | 'normal' | 'smooth' )
            // /home/ashwin/NetBeansProjects/test/src/test/Process.g:
            {
            if ( (input.LA(1)>=19 && input.LA(1)<=21) ) {
                input.consume();
                state.errorRecovery=false;
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "normal"


    // $ANTLR start "duration"
    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:56:1: duration returns [int dur] : ( INT MIN | INT HRS );
    public final int duration() throws RecognitionException {
        int dur = 0;

        Token INT2=null;

        try {
            // /home/ashwin/NetBeansProjects/test/src/test/Process.g:56:28: ( INT MIN | INT HRS )
            int alt9=2;
            int LA9_0 = input.LA(1);

            if ( (LA9_0==INT) ) {
                int LA9_1 = input.LA(2);

                if ( (LA9_1==MIN) ) {
                    alt9=1;
                }
                else if ( (LA9_1==HRS) ) {
                    alt9=2;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 9, 1, input);

                    throw nvae;
                }
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 9, 0, input);

                throw nvae;
            }
            switch (alt9) {
                case 1 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:56:30: INT MIN
                    {
                    INT2=(Token)match(input,INT,FOLLOW_INT_in_duration152); 
                    match(input,MIN,FOLLOW_MIN_in_duration154); 
                    dur =Integer.parseInt((INT2!=null?INT2.getText():null));

                    }
                    break;
                case 2 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:56:73: INT HRS
                    {
                    match(input,INT,FOLLOW_INT_in_duration157); 
                    match(input,HRS,FOLLOW_HRS_in_duration159); 

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return dur;
    }
    // $ANTLR end "duration"


    // $ANTLR start "prep"
    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:58:1: prep : ( 'at' | 'in' | 'by' );
    public final void prep() throws RecognitionException {
        try {
            // /home/ashwin/NetBeansProjects/test/src/test/Process.g:58:6: ( 'at' | 'in' | 'by' )
            // /home/ashwin/NetBeansProjects/test/src/test/Process.g:
            {
            if ( (input.LA(1)>=22 && input.LA(1)<=24) ) {
                input.consume();
                state.errorRecovery=false;
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "prep"


    // $ANTLR start "others"
    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:59:1: others : ( prep | COLON | DOT );
    public final void others() throws RecognitionException {
        try {
            // /home/ashwin/NetBeansProjects/test/src/test/Process.g:59:8: ( prep | COLON | DOT )
            int alt10=3;
            switch ( input.LA(1) ) {
            case 22:
            case 23:
            case 24:
                {
                alt10=1;
                }
                break;
            case COLON:
                {
                alt10=2;
                }
                break;
            case DOT:
                {
                alt10=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 10, 0, input);

                throw nvae;
            }

            switch (alt10) {
                case 1 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:59:10: prep
                    {
                    pushFollow(FOLLOW_prep_in_others178);
                    prep();

                    state._fsp--;


                    }
                    break;
                case 2 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:59:15: COLON
                    {
                    match(input,COLON,FOLLOW_COLON_in_others180); 

                    }
                    break;
                case 3 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:59:21: DOT
                    {
                    match(input,DOT,FOLLOW_DOT_in_others182); 

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "others"

    public static class time_return extends ParserRuleReturnScope {
        public int value1;
        public int value2;
    };

    // $ANTLR start "time"
    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:65:1: time returns [int value1,int value2] : ( timedef | timedef AM | timedef PM );
    public final ProcessParser.time_return time() throws RecognitionException {
        ProcessParser.time_return retval = new ProcessParser.time_return();
        retval.start = input.LT(1);

        ProcessParser.timedef_return timedef3 = null;

        ProcessParser.timedef_return timedef4 = null;

        ProcessParser.timedef_return timedef5 = null;


        try {
            // /home/ashwin/NetBeansProjects/test/src/test/Process.g:65:37: ( timedef | timedef AM | timedef PM )
            int alt11=3;
            int LA11_0 = input.LA(1);

            if ( (LA11_0==TIME) ) {
                switch ( input.LA(2) ) {
                case DOT:
                    {
                    switch ( input.LA(3) ) {
                    case FRACT:
                        {
                        switch ( input.LA(4) ) {
                        case EOF:
                        case ID:
                        case NEWLINE:
                        case TRAFFIC:
                        case COLON:
                        case DOT:
                        case 22:
                        case 23:
                        case 24:
                            {
                            alt11=1;
                            }
                            break;
                        case AM:
                            {
                            alt11=2;
                            }
                            break;
                        case PM:
                            {
                            alt11=3;
                            }
                            break;
                        default:
                            NoViableAltException nvae =
                                new NoViableAltException("", 11, 6, input);

                            throw nvae;
                        }

                        }
                        break;
                    case TIME:
                        {
                        switch ( input.LA(4) ) {
                        case EOF:
                        case ID:
                        case NEWLINE:
                        case TRAFFIC:
                        case COLON:
                        case DOT:
                        case 22:
                        case 23:
                        case 24:
                            {
                            alt11=1;
                            }
                            break;
                        case AM:
                            {
                            alt11=2;
                            }
                            break;
                        case PM:
                            {
                            alt11=3;
                            }
                            break;
                        default:
                            NoViableAltException nvae =
                                new NoViableAltException("", 11, 7, input);

                            throw nvae;
                        }

                        }
                        break;
                    case EOF:
                    case ID:
                    case NEWLINE:
                    case TRAFFIC:
                    case COLON:
                    case DOT:
                    case 22:
                    case 23:
                    case 24:
                        {
                        alt11=1;
                        }
                        break;
                    default:
                        NoViableAltException nvae =
                            new NoViableAltException("", 11, 2, input);

                        throw nvae;
                    }

                    }
                    break;
                case EOF:
                case ID:
                case NEWLINE:
                case TRAFFIC:
                case COLON:
                case 22:
                case 23:
                case 24:
                    {
                    alt11=1;
                    }
                    break;
                case AM:
                    {
                    alt11=2;
                    }
                    break;
                case PM:
                    {
                    alt11=3;
                    }
                    break;
                default:
                    NoViableAltException nvae =
                        new NoViableAltException("", 11, 1, input);

                    throw nvae;
                }

            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 11, 0, input);

                throw nvae;
            }
            switch (alt11) {
                case 1 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:65:38: timedef
                    {
                    pushFollow(FOLLOW_timedef_in_time196);
                    timedef3=timedef();

                    state._fsp--;

                    retval.value1 =(timedef3!=null?timedef3.value1:0);   retval.value2 =(timedef3!=null?timedef3.value2:0);

                    }
                    break;
                case 2 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:66:1: timedef AM
                    {
                    pushFollow(FOLLOW_timedef_in_time201);
                    timedef4=timedef();

                    state._fsp--;

                    match(input,AM,FOLLOW_AM_in_time203); 
                    retval.value1 =(timedef4!=null?timedef4.value1:0);   retval.value2 =(timedef4!=null?timedef4.value2:0);

                    }
                    break;
                case 3 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:67:1: timedef PM
                    {
                    pushFollow(FOLLOW_timedef_in_time207);
                    timedef5=timedef();

                    state._fsp--;

                    match(input,PM,FOLLOW_PM_in_time209); 

                    retval.value1 =((timedef5!=null?timedef5.value1:0)+12); 
                      retval.value2 =(timedef5!=null?timedef5.value2:0);

                    }
                    break;

            }
            retval.stop = input.LT(-1);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "time"

    public static class timedef_return extends ParserRuleReturnScope {
        public int value1;
        public int value2;
    };

    // $ANTLR start "timedef"
    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:72:1: timedef returns [int value1,int value2] : ( TIME | TIME DOT FRACT | a= TIME DOT b= TIME );
    public final ProcessParser.timedef_return timedef() throws RecognitionException {
        ProcessParser.timedef_return retval = new ProcessParser.timedef_return();
        retval.start = input.LT(1);

        Token a=null;
        Token b=null;
        Token TIME6=null;
        Token TIME7=null;
        Token FRACT8=null;

        try {
            // /home/ashwin/NetBeansProjects/test/src/test/Process.g:72:41: ( TIME | TIME DOT FRACT | a= TIME DOT b= TIME )
            int alt12=3;
            int LA12_0 = input.LA(1);

            if ( (LA12_0==TIME) ) {
                int LA12_1 = input.LA(2);

                if ( (LA12_1==DOT) ) {
                    switch ( input.LA(3) ) {
                    case FRACT:
                        {
                        alt12=2;
                        }
                        break;
                    case TIME:
                        {
                        alt12=3;
                        }
                        break;
                    case EOF:
                    case ID:
                    case NEWLINE:
                    case TRAFFIC:
                    case COLON:
                    case DOT:
                    case 22:
                    case 23:
                    case 24:
                        {
                        alt12=1;
                        }
                        break;
                    default:
                        NoViableAltException nvae =
                            new NoViableAltException("", 12, 2, input);

                        throw nvae;
                    }

                }
                else if ( (LA12_1==EOF||(LA12_1>=ID && LA12_1<=TRAFFIC)||LA12_1==COLON||(LA12_1>=AM && LA12_1<=PM)||(LA12_1>=22 && LA12_1<=24)) ) {
                    alt12=1;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 12, 1, input);

                    throw nvae;
                }
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 12, 0, input);

                throw nvae;
            }
            switch (alt12) {
                case 1 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:72:43: TIME
                    {
                    TIME6=(Token)match(input,TIME,FOLLOW_TIME_in_timedef223); 
                    retval.value1 =Integer.parseInt((TIME6!=null?TIME6.getText():null));

                    }
                    break;
                case 2 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:73:1: TIME DOT FRACT
                    {
                    TIME7=(Token)match(input,TIME,FOLLOW_TIME_in_timedef227); 
                    match(input,DOT,FOLLOW_DOT_in_timedef229); 
                    FRACT8=(Token)match(input,FRACT,FOLLOW_FRACT_in_timedef231); 
                    retval.value1 =Integer.parseInt((TIME7!=null?TIME7.getText():null));
                    retval.value2 =Integer.parseInt((FRACT8!=null?FRACT8.getText():null));

                    }
                    break;
                case 3 :
                    // /home/ashwin/NetBeansProjects/test/src/test/Process.g:74:41: a= TIME DOT b= TIME
                    {
                    a=(Token)match(input,TIME,FOLLOW_TIME_in_timedef236); 
                    match(input,DOT,FOLLOW_DOT_in_timedef238); 
                    b=(Token)match(input,TIME,FOLLOW_TIME_in_timedef243); 
                    retval.value1 =Integer.parseInt((a!=null?a.getText():null));
                    retval.value2 =Integer.parseInt((b!=null?b.getText():null));

                    }
                    break;

            }
            retval.stop = input.LT(-1);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "timedef"

    // Delegated rules


 

    public static final BitSet FOLLOW_alt_in_prog28 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_time_in_alt42 = new BitSet(new long[]{0x0000000001C01840L});
    public static final BitSet FOLLOW_others_in_alt45 = new BitSet(new long[]{0x0000000001C01840L});
    public static final BitSet FOLLOW_traffic_in_alt49 = new BitSet(new long[]{0x0000000001C00000L});
    public static final BitSet FOLLOW_prep_in_alt51 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ID_in_alt55 = new BitSet(new long[]{0x0000000001F81810L});
    public static final BitSet FOLLOW_others_in_alt58 = new BitSet(new long[]{0x0000000001F81810L});
    public static final BitSet FOLLOW_ID_in_alt60 = new BitSet(new long[]{0x0000000001F81810L});
    public static final BitSet FOLLOW_normal_in_alt64 = new BitSet(new long[]{0x0000000001C00000L});
    public static final BitSet FOLLOW_prep_in_alt66 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_time_in_alt70 = new BitSet(new long[]{0x0000000001C01832L});
    public static final BitSet FOLLOW_others_in_alt72 = new BitSet(new long[]{0x0000000001C01832L});
    public static final BitSet FOLLOW_ID_in_alt74 = new BitSet(new long[]{0x0000000001C01832L});
    public static final BitSet FOLLOW_NEWLINE_in_alt76 = new BitSet(new long[]{0x0000000001C01832L});
    public static final BitSet FOLLOW_ID_in_alt83 = new BitSet(new long[]{0x0000000001C01850L});
    public static final BitSet FOLLOW_others_in_alt85 = new BitSet(new long[]{0x0000000001C01850L});
    public static final BitSet FOLLOW_traffic_in_alt89 = new BitSet(new long[]{0x0000000001C00000L});
    public static final BitSet FOLLOW_prep_in_alt91 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ID_in_alt95 = new BitSet(new long[]{0x0000000001C09810L});
    public static final BitSet FOLLOW_ID_in_alt98 = new BitSet(new long[]{0x0000000001C09810L});
    public static final BitSet FOLLOW_others_in_alt100 = new BitSet(new long[]{0x0000000001C09810L});
    public static final BitSet FOLLOW_time_in_alt104 = new BitSet(new long[]{0x0000000001C01812L});
    public static final BitSet FOLLOW_ID_in_alt107 = new BitSet(new long[]{0x0000000001C01812L});
    public static final BitSet FOLLOW_others_in_alt109 = new BitSet(new long[]{0x0000000001C01812L});
    public static final BitSet FOLLOW_TRAFFIC_in_traffic123 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_TRAFFIC_in_traffic125 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_BLOCK_in_traffic127 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_normal0 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_INT_in_duration152 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_MIN_in_duration154 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_INT_in_duration157 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_HRS_in_duration159 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_prep0 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_prep_in_others178 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_COLON_in_others180 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_DOT_in_others182 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_timedef_in_time196 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_timedef_in_time201 = new BitSet(new long[]{0x0000000000002000L});
    public static final BitSet FOLLOW_AM_in_time203 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_timedef_in_time207 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_PM_in_time209 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_TIME_in_timedef223 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_TIME_in_timedef227 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_DOT_in_timedef229 = new BitSet(new long[]{0x0000000000010000L});
    public static final BitSet FOLLOW_FRACT_in_timedef231 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_TIME_in_timedef236 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_DOT_in_timedef238 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_TIME_in_timedef243 = new BitSet(new long[]{0x0000000000000002L});

}